<?php $this->placeholder('onReady')->captureStart() ?>
$("#myTable").tablesorter(); 

$('a.button').button();


$(".tareasdelete").live("click", function(e){
    	e.preventDefault();
    	var url=this.href;
        var tr = $(this).closest('li');
       
    	$('#dialog-confirm').dialog({buttons: { 
				"Borrar": function() {
					$.post(url,  function(data){
						if(data.status=='ok'){
						    $('#dialog-confirm').dialog("close");  
							tr.hide();
							
						}
						else
						{
							alert(data);
							$('#dialog-confirm').dialog("close");
						}
					})
				} ,
				"Cancelar": function() { $(this).dialog("close"); } 
			}
		})
	    .dialog('open');  
    })
    .css('cursor','pointer')
    .button({
            text: false,
            icons: {
                primary: "ui-icon-trash"
            }
    });




$( ".slider" ).slider({
        	value:0,
			min: 0,
			max: 100,
			step: 10,
            animate: true,
			slide: function( event, ui ) 
            {
				$(this).next().html( ui.value +'%').removeClass('ui-state-highlight').removeClass('ui-state-error');
			},
            stop: function( event, ui ) 
            {
                
                var aux= this.id.split('_')
                id=aux[1]
                $.post('proyectos-green-tareas/value',{value:ui.value,id_tarea:id}, function(data){
                    if(data.status=='ok')
                        $('#slider_'+data.id_tarea).html(data.value +'%').addClass('ui-state-highlight');
                    else
                        $('#slider_'+data.id_tarea).html('Error').addClass('ui-state-error');
                    
                });
               
                
			}
    }).each(function(index) {
        $(this).slider( "value" ,parseInt($(this).next().html()))
    });



<?php $this->placeholder('onReady')->captureEnd() ?>
<?$this->headScript()->offsetSetFile(100,$this->baseUrl('js/jquery.lightbox.js'));?>

<?$this->headLink()->appendStylesheet($this->baseUrl('css/lightbox.css'));?>


<?echo $this->msg($this->proyecto['proyecto'],'head',null,false)?>
<div class="contenedor_tablesorter">
<table width="100%" class="tabla_descriptiva_proyecto">
<tbody>
<tr>
	<th class="ui-state-hover" width="25%"><?php echo $this->translate('Datacenter');?></th><td width="25%" class="ui-state-highlight"><?=$this->proyecto['zona']?></td>
	<th class="ui-state-hover"><?php echo $this->translate('Fecha Apertura');?></th><td class="ui-state-highlight"><?=$this->proyecto['f_inicio']?></td>

</tr>	
<tr>
	<th class="ui-state-hover" width="25%"><?php echo $this->translate('Area');?> / <?php echo $this->translate('Estado');?> / <?php echo $this->translate('Prioridad');?></th><td width="25%" class="ui-state-highlight"><?=$this->proyecto['area']?> / <?=$this->proyecto['estado']?> / <?=$this->proyecto['prioridad']?></td>
	<th class="ui-state-hover"><?php echo $this->translate('Fecha Entrega');?></th><td class="ui-state-highlight"><?=$this->proyecto['f_entrega']?></td>

</tr>	
<tr>
	<th class="ui-state-hover">&nbsp;<?php echo $this->translate('Responsable');?></th><td class="ui-state-highlight">&nbsp;<?=$this->proyecto['responsable']?></td>
	<th class="ui-state-hover">&nbsp;<?php echo $this->translate('Fecha Replanificación');?></th><td class="ui-state-highlight">&nbsp;<?=$this->$proyecto['f_repla']?></td>

</tr>	
<tr>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('Oferta Asociada');?></th><td class="ui-state-highlight">&nbsp;<?=$this->link($this->proyecto['oferta'],'Gestion_OfertasTareas',array('id'=>$this->proyecto['id_oferta']))?></td>
	<th class="ui-state-hover">&nbsp;<?php echo $this->translate('Fecha Cierre');?></th><td class="ui-state-highlight">&nbsp;<?=$this->$proyecto['f_final']?></td>
</tr>
<tr>
	<th class="ui-state-hover">&nbsp;NOC</th><td class="ui-state-highlight">&nbsp;<?=$this->proyecto['file_noc'];?></td>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('Importe NOC');?></th><td class="ui-state-highlight">&nbsp;<?=$this->NumEs($this->proyecto['importe_noc'],0) ?></td>
</tr>
<tr>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('Gestión Medio Ambiental');?></th><td class="ui-state-highlight">&nbsp;<?=$this->proyecto['gma_text'] ?>  </td>
	<th class="ui-state-hover">&nbsp;<?php echo $this->translate('Balance');?></th><td class="ui-state-highlight">&nbsp;<?=$this->NumEs($this->proyecto['balance'],0)?></td>
</tr>
<tr>
	<th class="ui-state-hover">&nbsp;<?php echo $this->translate('PRL');?></th>
    
    <td class="ui-state-highlight">&nbsp;<?php if($this->proyecto['prl'])
    echo $this->translate('Ver PRL').' '.$this->anchor('proyectosdc-prl/editar/id/'.$this->id_proyecto,'Formulario PRL',array('class'=>'utileditar'));?>
    
    </td>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('Importe Comprometido');?></th><td class="ui-state-highlight">&nbsp;<?=$this->NumEs($importe_comprometido,0) ?></td>
    
 </tr>
<tr>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('CMI');?></th><td class="ui-state-highlight">&nbsp;<?=$this->proyecto['cmi_text'] ?></td>
	<th class="ui-state-hover">&nbsp;<?php echo $this->translate('Control Económico');?></th>
    <td class="ui-state-highlight">&nbsp;
    
    <?if($this->proyecto['control_economico']) {
        echo $this->anchor('/proyectosdc-capex-detalle/index/id_proyecto/'.$this->id_proyecto,$this->proyecto['control_economico'],array('class'=>'button'));
    }else{
             echo $this->anchor('/proyectosdc-capex-detalle/index/id_proyecto/'.$this->id_proyecto,'Control',array('class'=>'button'));
    } ?>
    </td>
</tr>
<tr>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('Usuarios permitidos');?></th><td class="ui-state-highlight">&nbsp;<?=implode('<br>',$this->proyecto['permisos'])?></td>
    <th class="ui-state-hover">&nbsp;<?php echo $this->translate('Descripción');?></th><td colspan="2" class="ui-state-highlight">&nbsp;<?=$this->text($this->proyecto['notas'])?></td>	
</tr>
</tbody>		
</table>

<?if($this->proyecto['gma']):?>
<?=$this->msg($this->showPhotos('gma','docu','file',true,false,false),'atencion','Documentación para Proyectos de Gestión Medio Ambiental',null,false);?>

<?endif?>


<?php echo $this->partial($this->controllerName.'/tareas.phtml', array('tareas'=>$this->tareas)); ?>



<?php echo $this->anchor($this->controllerName.'/insertar/id_proyecto/'.$this->id_proyecto,'Añadir',array('class'=>'utiladd'));?>


<?php echo $this->partialLoop($this->controllerName.'/fila.phtml', (array)$this->rows); ?>
</div>